\(\int \frac {(a+b \log (c (d+e x)^n))^2}{(f+g x) (h+i x)} \, dx\) [227]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 31, antiderivative size = 264 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g h-f i}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{g h-f i}+\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}-\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i}-\frac {2 b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}+\frac {2 b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i} \]

[Out]

(a+b*ln(c*(e*x+d)^n))^2*ln(e*(g*x+f)/(-d*g+e*f))/(-f*i+g*h)-(a+b*ln(c*(e*x+d)^n))^2*ln(e*(i*x+h)/(-d*i+e*h))/(
-f*i+g*h)+2*b*n*(a+b*ln(c*(e*x+d)^n))*polylog(2,-g*(e*x+d)/(-d*g+e*f))/(-f*i+g*h)-2*b*n*(a+b*ln(c*(e*x+d)^n))*
polylog(2,-i*(e*x+d)/(-d*i+e*h))/(-f*i+g*h)-2*b^2*n^2*polylog(3,-g*(e*x+d)/(-d*g+e*f))/(-f*i+g*h)+2*b^2*n^2*po
lylog(3,-i*(e*x+d)/(-d*i+e*h))/(-f*i+g*h)

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 264, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {2465, 2443, 2481, 2421, 6724} \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\frac {2 b n \operatorname {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g h-f i}-\frac {2 b n \operatorname {PolyLog}\left (2,-\frac {i (d+e x)}{e h-d i}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g h-f i}+\frac {\log \left (\frac {e (f+g x)}{e f-d g}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g h-f i}-\frac {\log \left (\frac {e (h+i x)}{e h-d i}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g h-f i}-\frac {2 b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}+\frac {2 b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i} \]

[In]

Int[(a + b*Log[c*(d + e*x)^n])^2/((f + g*x)*(h + i*x)),x]

[Out]

((a + b*Log[c*(d + e*x)^n])^2*Log[(e*(f + g*x))/(e*f - d*g)])/(g*h - f*i) - ((a + b*Log[c*(d + e*x)^n])^2*Log[
(e*(h + i*x))/(e*h - d*i)])/(g*h - f*i) + (2*b*n*(a + b*Log[c*(d + e*x)^n])*PolyLog[2, -((g*(d + e*x))/(e*f -
d*g))])/(g*h - f*i) - (2*b*n*(a + b*Log[c*(d + e*x)^n])*PolyLog[2, -((i*(d + e*x))/(e*h - d*i))])/(g*h - f*i)
- (2*b^2*n^2*PolyLog[3, -((g*(d + e*x))/(e*f - d*g))])/(g*h - f*i) + (2*b^2*n^2*PolyLog[3, -((i*(d + e*x))/(e*
h - d*i))])/(g*h - f*i)

Rule 2421

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> Simp
[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c*x^n])^p/m), x] + Dist[b*n*(p/m), Int[PolyLog[2, (-d)*f*x^m]*((a + b*L
og[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 2443

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((
f + g*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])^p/g), x] - Dist[b*e*n*(p/g), Int[Log[(e*(f + g*x))/(e*f - d
*g)]*((a + b*Log[c*(d + e*x)^n])^(p - 1)/(d + e*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*
f - d*g, 0] && IGtQ[p, 1]

Rule 2465

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2481

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*
(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(k*(x/d))^r*(a + b*Log[c*x^n])^p*(f + g*Lo
g[h*((e*i - d*j)/e + j*(x/e))^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, j, k, l, n, p, r},
 x] && EqQ[e*k - d*l, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(g h-f i) (f+g x)}-\frac {i \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(g h-f i) (h+i x)}\right ) \, dx \\ & = \frac {g \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x} \, dx}{g h-f i}-\frac {i \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{h+i x} \, dx}{g h-f i} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g h-f i}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{g h-f i}-\frac {(2 b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{d+e x} \, dx}{g h-f i}+\frac {(2 b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (h+i x)}{e h-d i}\right )}{d+e x} \, dx}{g h-f i} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g h-f i}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{g h-f i}-\frac {(2 b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e f-d g}{e}+\frac {g x}{e}\right )}{e f-d g}\right )}{x} \, dx,x,d+e x\right )}{g h-f i}+\frac {(2 b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e h-d i}{e}+\frac {i x}{e}\right )}{e h-d i}\right )}{x} \, dx,x,d+e x\right )}{g h-f i} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g h-f i}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{g h-f i}+\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}-\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i}-\frac {\left (2 b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {g x}{e f-d g}\right )}{x} \, dx,x,d+e x\right )}{g h-f i}+\frac {\left (2 b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {i x}{e h-d i}\right )}{x} \, dx,x,d+e x\right )}{g h-f i} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g h-f i}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{g h-f i}+\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}-\frac {2 b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i}-\frac {2 b^2 n^2 \text {Li}_3\left (-\frac {g (d+e x)}{e f-d g}\right )}{g h-f i}+\frac {2 b^2 n^2 \text {Li}_3\left (-\frac {i (d+e x)}{e h-d i}\right )}{g h-f i} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 353, normalized size of antiderivative = 1.34 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\frac {\left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log (f+g x)-\left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log (h+i x)+2 b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (\log (d+e x) \left (\log \left (\frac {e (f+g x)}{e f-d g}\right )-\log \left (\frac {e (h+i x)}{e h-d i}\right )\right )+\operatorname {PolyLog}\left (2,\frac {g (d+e x)}{-e f+d g}\right )-\operatorname {PolyLog}\left (2,\frac {i (d+e x)}{-e h+d i}\right )\right )+b^2 n^2 \left (\log ^2(d+e x) \log \left (\frac {e (f+g x)}{e f-d g}\right )-\log ^2(d+e x) \log \left (\frac {e (h+i x)}{e h-d i}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {g (d+e x)}{-e f+d g}\right )-2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {i (d+e x)}{-e h+d i}\right )-2 \operatorname {PolyLog}\left (3,\frac {g (d+e x)}{-e f+d g}\right )+2 \operatorname {PolyLog}\left (3,\frac {i (d+e x)}{-e h+d i}\right )\right )}{g h-f i} \]

[In]

Integrate[(a + b*Log[c*(d + e*x)^n])^2/((f + g*x)*(h + i*x)),x]

[Out]

((a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])^2*Log[f + g*x] - (a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])^
2*Log[h + i*x] + 2*b*n*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])*(Log[d + e*x]*(Log[(e*(f + g*x))/(e*f - d
*g)] - Log[(e*(h + i*x))/(e*h - d*i)]) + PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)] - PolyLog[2, (i*(d + e*x))/(
-(e*h) + d*i)]) + b^2*n^2*(Log[d + e*x]^2*Log[(e*(f + g*x))/(e*f - d*g)] - Log[d + e*x]^2*Log[(e*(h + i*x))/(e
*h - d*i)] + 2*Log[d + e*x]*PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)] - 2*Log[d + e*x]*PolyLog[2, (i*(d + e*x))
/(-(e*h) + d*i)] - 2*PolyLog[3, (g*(d + e*x))/(-(e*f) + d*g)] + 2*PolyLog[3, (i*(d + e*x))/(-(e*h) + d*i)]))/(
g*h - f*i)

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 2.90 (sec) , antiderivative size = 1427, normalized size of antiderivative = 5.41

method result size
risch \(\text {Expression too large to display}\) \(1427\)

[In]

int((a+b*ln(c*(e*x+d)^n))^2/(g*x+f)/(i*x+h),x,method=_RETURNVERBOSE)

[Out]

b^2/(f*i-g*h)*ln(i*(e*x+d)-d*i+e*h)*ln(e*x+d)^2*n^2-2*b^2/(f*i-g*h)*ln(i*(e*x+d)-d*i+e*h)*ln((e*x+d)^n)*ln(e*x
+d)*n+b^2/(f*i-g*h)*ln(i*(e*x+d)-d*i+e*h)*ln((e*x+d)^n)^2-b^2/(f*i-g*h)*ln(g*(e*x+d)-d*g+e*f)*ln(e*x+d)^2*n^2+
2*b^2/(f*i-g*h)*ln(g*(e*x+d)-d*g+e*f)*ln((e*x+d)^n)*ln(e*x+d)*n-b^2/(f*i-g*h)*ln(g*(e*x+d)-d*g+e*f)*ln((e*x+d)
^n)^2+b^2*n^2/(f*i-g*h)*ln(e*x+d)^2*ln(1+i*(e*x+d)/(-d*i+e*h))+2*b^2*n^2/(f*i-g*h)*ln(e*x+d)*polylog(2,-i*(e*x
+d)/(-d*i+e*h))-2*b^2*n^2/(f*i-g*h)*polylog(3,-i*(e*x+d)/(-d*i+e*h))-b^2*n^2/(f*i-g*h)*ln(e*x+d)^2*ln(1+g*(e*x
+d)/(-d*g+e*f))-2*b^2*n^2/(f*i-g*h)*ln(e*x+d)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(g*x+f)*ln(((g*x+f)*e+d*g-e*f)/(d*g-e*f))/e)))+1/4*(-I*b*Pi*csgn(I*c*(e*x+d)^n)*csgn(I*c)*csgn(I*(
e*x+d)^n)+I*Pi*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2*b+I*Pi*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2*b-I*Pi*csgn(I*c*
(e*x+d)^n)^3*b+2*b*ln(c)+2*a)^2*(1/(f*i-g*h)*ln(i*x+h)-1/(f*i-g*h)*ln(g*x+f))

Fricas [F]

\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x + f\right )} {\left (i x + h\right )}} \,d x } \]

[In]

integrate((a+b*log(c*(e*x+d)^n))^2/(g*x+f)/(i*x+h),x, algorithm="fricas")

[Out]

integral((b^2*log((e*x + d)^n*c)^2 + 2*a*b*log((e*x + d)^n*c) + a^2)/(g*i*x^2 + f*h + (g*h + f*i)*x), x)

Sympy [F]

\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\int \frac {\left (a + b \log {\left (c \left (d + e x\right )^{n} \right )}\right )^{2}}{\left (f + g x\right ) \left (h + i x\right )}\, dx \]

[In]

integrate((a+b*ln(c*(e*x+d)**n))**2/(g*x+f)/(i*x+h),x)

[Out]

Integral((a + b*log(c*(d + e*x)**n))**2/((f + g*x)*(h + i*x)), x)

Maxima [F]

\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x + f\right )} {\left (i x + h\right )}} \,d x } \]

[In]

integrate((a+b*log(c*(e*x+d)^n))^2/(g*x+f)/(i*x+h),x, algorithm="maxima")

[Out]

a^2*(log(g*x + f)/(g*h - f*i) - log(i*x + h)/(g*h - f*i)) + integrate((b^2*log((e*x + d)^n)^2 + b^2*log(c)^2 +
 2*a*b*log(c) + 2*(b^2*log(c) + a*b)*log((e*x + d)^n))/(g*i*x^2 + f*h + (g*h + f*i)*x), x)

Giac [F]

\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x + f\right )} {\left (i x + h\right )}} \,d x } \]

[In]

integrate((a+b*log(c*(e*x+d)^n))^2/(g*x+f)/(i*x+h),x, algorithm="giac")

[Out]

integrate((b*log((e*x + d)^n*c) + a)^2/((g*x + f)*(i*x + h)), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{\left (f+g\,x\right )\,\left (h+i\,x\right )} \,d x \]

[In]

int((a + b*log(c*(d + e*x)^n))^2/((f + g*x)*(h + i*x)),x)

[Out]

int((a + b*log(c*(d + e*x)^n))^2/((f + g*x)*(h + i*x)), x)